<template>
    <div>
        <div>
            <div class="level_title">
                <ul class="level_ul">
                    <li>系统设置</li>
                    <i class=""> > </i>
                    <li>导航设置</li>
                    <i class=""> > </i>
                    <li>添加导航栏</li>
                </ul>
            </div>
        </div>
            <form class="add-form">
                <div class="form-group row">
                    <label for="colFormLabelSm1" class="col-md-4 col-form-label text-md-right">Name</label>
                    <div class="col-md-6">
                        <input type="text" v-model="name" class="form-control" id="colFormLabelSm1" placeholder="Name">
                    </div>
                </div>
                <div class="form-group row">
                    <label for="colFormLabelSm2" class="col-md-4 col-form-label text-md-right">Type</label>
                    <div class="col-md-6">
                        <select name="Type" v-model="type" id="colFormLabelSm2" class="form-control">
                            <option value="1">link</option>
                            <option value="2">button</option>
                        </select>
                    </div>
                </div>
                <div class="form-group row">
                    <label for="colFormLabelSm3" class="col-md-4 col-form-label text-md-right">Weight</label>
                    <div class="col-md-6">
                        <input type="number" v-model="weight" class="form-control" id="colFormLabelSm3" placeholder="Weight" maxlength="100">
                    </div>
                </div>
                <div class="form-group row">
                    <label for="colFormLabelSm4" class="col-md-4 col-form-label text-md-right">URL</label>
                    <div class="col-md-6">
                        <input type="text" v-model="url" class="form-control" id="colFormLabelSm4" placeholder="URL">
                    </div>
                </div>
            </form>
        <div class="form-group row mb-0">
            <div class="col-md-8 offset-md-6">
                <button class="btn btn-primary" @click="submitFirstLevel">
                    提交
                </button>
                <router-link class="btn btn-link" to="/">返回</router-link>
                <!--<a class="btn btn-link" href="{{ route('password.request') }}">

                </a>-->
            </div>
        </div>
        </div>
</template>

<script>
    import {addFirstLevel} from "../../api/api";

    export default {
        name: "FirstLevel",
        data() {
            return {
                name: "",
                type: "",
                weight: "",
                url: ""
            }
        },
        methods: {
            submitFirstLevel: function() {
                let data = {
                    name: this.name,
                    type: this.type,
                    weight: this.weight,
                    url: this.url
                };
                addFirstLevel(data).then((response)=> {

                }).catch(function (error) {
                    console.log(error);
                });
            }
        }
    }
</script>

<style scoped>

</style>
